<!doctype html>



  


<html class="theme-next mist use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css"/>




  <link href="//fonts.googleapis.com/css?family=Lato:300,400,700,400italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">



<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=0.5.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="工具使用,SublimeText,插件,力所能及的分享," />








  <link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico?v=0.5.0" />






<meta name="description" content="SublimeText3是我最喜欢的编辑器，如果你跟我争Vim或者Emacs，来来来，先出门打一架……喜欢归因于它丰富的插件，ST2插件装多了启动会变得很慢，而ST3完全解决了这个问题，无论装多少插件，一律秒开，因为有朋友想装插件，在这里列举一些我个人很喜欢的，权当做分享。
科学上网传送门">
<meta property="og:type" content="article">
<meta property="og:title" content="SublimeText 插件推荐">
<meta property="og:url" content="http://lijundong.com/2016/03/17/SublimeText-插件推荐/index.html">
<meta property="og:site_name" content="Leeon's BLOG">
<meta property="og:description" content="SublimeText3是我最喜欢的编辑器，如果你跟我争Vim或者Emacs，来来来，先出门打一架……喜欢归因于它丰富的插件，ST2插件装多了启动会变得很慢，而ST3完全解决了这个问题，无论装多少插件，一律秒开，因为有朋友想装插件，在这里列举一些我个人很喜欢的，权当做分享。
科学上网传送门">
<meta property="og:image" content="http://7xlkdt.com1.z0.glb.clouddn.com/16-3-17/81113868.jpg">
<meta property="og:image" content="http://7xlkdt.com1.z0.glb.clouddn.com/16-3-17/49212030.jpg">
<meta property="og:image" content="http://7xlkdt.com1.z0.glb.clouddn.com/16-3-17/33463949.jpg">
<meta property="og:image" content="http://7xlkdt.com1.z0.glb.clouddn.com/16-3-17/76484603.jpg">
<meta property="og:image" content="http://7xlkdt.com1.z0.glb.clouddn.com/16-3-17/44002025.jpg">
<meta property="og:updated_time" content="2016-06-07T14:10:31.959Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="SublimeText 插件推荐">
<meta name="twitter:description" content="SublimeText3是我最喜欢的编辑器，如果你跟我争Vim或者Emacs，来来来，先出门打一架……喜欢归因于它丰富的插件，ST2插件装多了启动会变得很慢，而ST3完全解决了这个问题，无论装多少插件，一律秒开，因为有朋友想装插件，在这里列举一些我个人很喜欢的，权当做分享。
科学上网传送门">
<meta name="twitter:image" content="http://7xlkdt.com1.z0.glb.clouddn.com/16-3-17/81113868.jpg">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Mist',
    sidebar: {"position":"left","display":"hide"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: 0,
      author: 'Author'
    }
  };
</script>

  <title> SublimeText 插件推荐 | Leeon's BLOG </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="en">

  



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?c6907c4f3552baba34e8ee2c5980996d";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">Leeon's BLOG</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle"></p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-home fa-fw"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-th fa-fw"></i> <br />
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-user fa-fw"></i> <br />
            
            About
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-archive fa-fw"></i> <br />
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-tags fa-fw"></i> <br />
            
            Tags
          </a>
        </li>
      

      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                SublimeText 插件推荐
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2016-03-17T09:43:02+08:00" content="2016-03-17">
              2016-03-17
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/工具使用/" itemprop="url" rel="index">
                    <span itemprop="name">工具使用</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2016/03/17/SublimeText-插件推荐/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2016/03/17/SublimeText-插件推荐/" itemprop="commentsCount"></span>
                </a>
              </span>
            

          

          

          
          
             <span id="/2016/03/17/SublimeText-插件推荐/" class="leancloud_visitors" data-flag-title="SublimeText 插件推荐">
               &nbsp; | &nbsp;
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               <span class="post-meta-item-text">visitors </span>
               <span class="leancloud-visitors-count"></span>
              </span>
          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>SublimeText3是我最喜欢的编辑器，如果你跟我争Vim或者Emacs，来来来，先出门打一架……<br>喜欢归因于它丰富的插件，ST2插件装多了启动会变得很慢，而ST3完全解决了这个问题，无论装多少插件，一律秒开，因为有朋友想装插件，在这里列举一些我个人很喜欢的，权当做分享。</p>
<p><strong><a href="http://www.lijundong.com/2015/11/08/%E7%A7%91%E5%AD%A6%E4%B8%8A%E7%BD%91/" target="_blank" rel="external">科学上网传送门</a></strong><br><a id="more"></a></p>
<h2 id="插件安装"><a href="#插件安装" class="headerlink" title="插件安装"></a>插件安装</h2><h3 id="Package-Control"><a href="#Package-Control" class="headerlink" title="Package Control"></a>Package Control</h3><p>Package Control可以非常方便的管理插件，<strong>打开 <code>Ctrl + ~</code>输入安装代码</strong>，安装代码:</p>
<p><strong>SublimeText2</strong><br><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> urllib2,os; pf=<span class="string">'Package Control.sublime-package'</span>; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) <span class="keyword">if</span> <span class="keyword">not</span> os.path.exists(ipp) <span class="keyword">else</span> <span class="keyword">None</span>; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), <span class="string">'wb'</span> ).write( urllib2.urlopen( <span class="string">'http://sublime.wbond.net/'</span> +pf.replace( <span class="string">' '</span>,<span class="string">'%20'</span> )).read()); print( <span class="string">'Please restart Sublime Text to finish installation'</span>)</span><br></pre></td></tr></table></figure></p>
<p><strong>SublimeText3</strong><br><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> urllib.request,os; pf = <span class="string">'Package Control.sublime-package'</span>; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), <span class="string">'wb'</span>).write(urllib.request.urlopen( <span class="string">'http://sublime.wbond.net/'</span> + pf.replace(<span class="string">' '</span>,<span class="string">'%20'</span>)).read())</span><br></pre></td></tr></table></figure></p>
<h3 id="插件安装-1"><a href="#插件安装-1" class="headerlink" title="插件安装"></a>插件安装</h3><p><strong><code>Ctrl + Shift + P</code>打开控制面板</strong></p>
<p><strong>输入<code>installPackage</code> 回车</strong><br><img src="http://7xlkdt.com1.z0.glb.clouddn.com/16-3-17/81113868.jpg" alt=""></p>
<p><strong>输入插件名，回车安装</strong><br><img src="http://7xlkdt.com1.z0.glb.clouddn.com/16-3-17/49212030.jpg" alt=""></p>
<p><strong>控制面板，选择<code>listPackage</code>可以看到已经安装的插件</strong></p>
<p><img src="http://7xlkdt.com1.z0.glb.clouddn.com/16-3-17/33463949.jpg" alt=""><br><img src="http://7xlkdt.com1.z0.glb.clouddn.com/16-3-17/76484603.jpg" alt=""></p>
<h2 id="插件"><a href="#插件" class="headerlink" title="插件"></a>插件</h2><h3 id="自动补全"><a href="#自动补全" class="headerlink" title="自动补全"></a>自动补全</h3><ul>
<li>Emmet: 前端开发神器，如果没听过，请出门左转Google，<strong>注意的是Emmet需要和PyV8这个插件才能工作，所以PyV8也需要装</strong></li>
<li>AutofileName: 提示文件名，并可以自动补全</li>
<li>Autoprefixer: CSS前缀自动补全</li>
<li>SublimeCodeIntel: 代码自动提示以及补全</li>
</ul>
<h3 id="高亮"><a href="#高亮" class="headerlink" title="高亮"></a>高亮</h3><ul>
<li>BracketHighlighter: 括号以及标签高亮，方便找到括号/标签的头与尾</li>
<li>Color Highlighter: 这个很好用，对CSS颜色代码进行高亮，如<code>#f00</code>会出现一条红色的下划线。</li>
<li>LESS: 对LESS代码进行高亮</li>
</ul>
<h3 id="格式"><a href="#格式" class="headerlink" title="格式"></a>格式</h3><ul>
<li>CSScomb: 对CSS代码进行格式化</li>
<li>JsFormat: JS代码格式化</li>
<li>HTML格式化: 试过很多HTML格式化的插件，但是效果并不好，后来才发现ST自己有个功能”reindent”,于是自己设置了快捷键，如下。<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[</span><br><span class="line">    &#123;<span class="attr">"keys"</span>: [<span class="string">"ctrl+shift+o"</span>], <span class="attr">"command"</span>: <span class="string">"reindent"</span> , <span class="attr">"args"</span>: &#123;<span class="attr">"single_line"</span>: <span class="literal">false</span>&#125;&#125;</span><br><span class="line">]</span><br></pre></td></tr></table></figure>
</li>
</ul>
<h3 id="开发"><a href="#开发" class="headerlink" title="开发"></a>开发</h3><ul>
<li>Git: 可以直接在控制面板用Git，不过还是需要先学习下</li>
<li>ColorPicker: 取色插件，</li>
<li>LiveReload: 我非常喜欢这个插件，配合Chrome的liveReload插件可以做到在编辑器保存文件Chrome立即刷新页面。<br>Chrome的插件安装之后，打开(点下图红圈圈，中心点变成黑色即意味打开)即可与ST配合使用。<br><img src="http://7xlkdt.com1.z0.glb.clouddn.com/16-3-17/44002025.jpg" alt=""><br>除了写写页面用到这个插件，还有其他用途，我的Markdown预览到Chrome，打开liveReload，边写边看效果，还有Hexo打开调试时，打开liveReload，保存一次，页面刷新一次，省了很多不必要的麻烦，很方便。</li>
<li>View In Browser: 在浏览器预览HTMl文件，设置快捷键之后更方便。</li>
</ul>
<h3 id="Markdown"><a href="#Markdown" class="headerlink" title="Markdown"></a>Markdown</h3><ul>
<li>Markdown Preview: 在浏览器中预览Markdown文件。</li>
<li>Markdown Editing: Markdown编辑界面，语法高亮，写这篇文章的时候用的就在用。</li>
<li>极简图床: 这是Chrome插件，之前很苦恼Markdown的图片存哪合适，这个插件可以很好的解决这个问题，申请一个七牛免费2G空间，用这个插件存图片，很方便。</li>
</ul>
<h3 id="主题"><a href="#主题" class="headerlink" title="主题"></a>主题</h3><ul>
<li>Predawn</li>
<li>Theme-Flatland</li>
<li>Theme-Soda</li>
<li>Theme-itg.flat</li>
</ul>
<h3 id="分不了类的"><a href="#分不了类的" class="headerlink" title="分不了类的"></a>分不了类的</h3><ul>
<li>IMESupport: ST中文输入时，输入框不跟随的问题可以通过这个插件解决。</li>
</ul>
<h2 id="设置"><a href="#设置" class="headerlink" title="设置"></a>设置</h2><p>下面是我的设置<br><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">    <span class="attr">"caret_extra_width"</span>: <span class="number">1</span>,</span><br><span class="line">    <span class="attr">"font_options"</span>:</span><br><span class="line">    [</span><br><span class="line">        <span class="string">"no_round"</span></span><br><span class="line">    ],</span><br><span class="line">    <span class="attr">"font_size"</span>: <span class="number">12</span>,</span><br><span class="line">    <span class="attr">"highlight_line"</span>: <span class="literal">true</span>,</span><br><span class="line">    <span class="attr">"ignored_packages"</span>:</span><br><span class="line">    [</span><br><span class="line">        <span class="string">"Markdown"</span>,</span><br><span class="line">        <span class="string">"Vintage"</span></span><br><span class="line">    ],</span><br><span class="line">    <span class="attr">"itg_sidebar_tree_large"</span>: <span class="literal">true</span>,</span><br><span class="line">    <span class="attr">"itg_small_tabs"</span>: <span class="literal">true</span>,</span><br><span class="line">    <span class="attr">"original_color_scheme"</span>: <span class="string">"Packages/Color Scheme - Default/Monokai.tmTheme"</span>,</span><br><span class="line">    <span class="attr">"sidebar_large"</span>: <span class="literal">true</span>,</span><br><span class="line">    <span class="attr">"tabs_small"</span>: <span class="literal">true</span>,</span><br><span class="line">    <span class="attr">"theme"</span>: <span class="string">"itg.flat.dark.sublime-theme"</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p>快捷键设置<br><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">[</span><br><span class="line">    &#123; <span class="attr">"keys"</span>: [<span class="string">"ctrl+shift+enter"</span>], <span class="attr">"command"</span>: <span class="string">"open_in_browser"</span> &#125;,</span><br><span class="line">    &#123; <span class="attr">"keys"</span>: [<span class="string">"ctrl+shift+s"</span>], <span class="attr">"command"</span>: <span class="string">"save_all"</span> &#125;,</span><br><span class="line">    &#123;<span class="attr">"keys"</span>: [<span class="string">"ctrl+shift+o"</span>], <span class="attr">"command"</span>: <span class="string">"reindent"</span> , <span class="attr">"args"</span>: &#123;<span class="attr">"single_line"</span>: <span class="literal">false</span>&#125;&#125;,</span><br><span class="line">    &#123;<span class="attr">"keys"</span>:[<span class="string">"alt+m"</span>],<span class="attr">"command"</span>:<span class="string">"markdown_preview"</span>&#125;</span><br><span class="line"></span><br><span class="line">]</span><br></pre></td></tr></table></figure></p>

      
    </div>

    <div>
      
        
      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/工具使用/" rel="tag">#工具使用</a>
          
            <a href="/tags/SublimeText/" rel="tag">#SublimeText</a>
          
            <a href="/tags/插件/" rel="tag">#插件</a>
          
            <a href="/tags/力所能及的分享/" rel="tag">#力所能及的分享</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2016/03/11/清除浮动/" rel="next" title="清除浮动">
                <i class="fa fa-chevron-left"></i> 清除浮动
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2016/03/27/但求好事/" rel="prev" title="但求好事">
                但求好事 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2016/03/17/SublimeText-插件推荐/"
           data-title="SublimeText 插件推荐" data-url="http://lijundong.com/2016/03/17/SublimeText-插件推荐/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            Overview
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="http://7xlkdt.com1.z0.glb.clouddn.com/16-3-18/59657432.jpg"
               alt="Leeon" />
          <p class="site-author-name" itemprop="name">Leeon</p>
          <p class="site-description motion-element" itemprop="description">笔记来的</p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">32</span>
              <span class="site-state-item-name">posts</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">6</span>
                <span class="site-state-item-name">categories</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">54</span>
                <span class="site-state-item-name">tags</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/lijundong" target="_blank">
                  
                    <i class="fa fa-github-square"></i> GitHub
                  
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://plus.google.com/u/0/105476317091375278758" target="_blank">
                  
                    <i class="fa fa-google-plus-square"></i> Google+
                  
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/Jundong_Li" target="_blank">
                  
                    <i class="fa fa-twitter"></i> Twitter
                  
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://www.facebook.com/coderleon?ref=bookmarks" target="_blank">
                  
                    <i class="fa fa-facebook-square"></i> facebook
                  
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.douban.com/people/103163980/" target="_blank">
                  
                    <i class="fa fa-spinner"></i> 豆
                  
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://www.zhihu.com/people/leon-lee-42" target="_blank">
                  
                    <i class="fa fa-spinner"></i> 知
                  
                </a>
              </span>
            
          
        </div>

        
        

        
        <div class="links-of-blogroll motion-element">
          
        </div>

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc-indicator-top post-toc-indicator">
            <i class="fa fa-angle-double-up"></i>
          </div>
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#插件安装"><span class="nav-text">插件安装</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Package-Control"><span class="nav-text">Package Control</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#插件安装-1"><span class="nav-text">插件安装</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#插件"><span class="nav-text">插件</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#自动补全"><span class="nav-text">自动补全</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#高亮"><span class="nav-text">高亮</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#格式"><span class="nav-text">格式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#开发"><span class="nav-text">开发</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Markdown"><span class="nav-text">Markdown</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#主题"><span class="nav-text">主题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#分不了类的"><span class="nav-text">分不了类的</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#设置"><span class="nav-text">设置</span></a></li></ol></div>
            
          </div>
          <div class="post-toc-indicator-bottom post-toc-indicator">
            <i class="fa fa-angle-double-down"></i>
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2015 - 
  <span itemprop="copyrightYear">2016</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Leeon</span>
</div>

<div class="powered-by">
  Powered by <a class="theme-link" href="http://hexo.io" rel="external nofollow">Hexo</a>
</div>

<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next" rel="external nofollow">
    NexT.Mist
  </a>
</div>



      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  


  




<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>


  <script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>

  <script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  <script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  <script type="text/javascript" src="/vendors/velocity/velocity.min.js"></script>

  <script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js"></script>

  <script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=0.5.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=0.5.0"></script>



  
  

  
  
<script type="text/javascript" src="/js/src/scrollspy.js?v=0.5.0"></script>

<script type="text/javascript" id="sidebar.toc.highlight">
  $(document).ready(function () {
    var tocSelector = '.post-toc';
    var $tocSelector = $(tocSelector);
    var activeCurrentSelector = '.active-current';

    $tocSelector
      .on('activate.bs.scrollspy', function () {
        var $currentActiveElement = $(tocSelector + ' .active').last();

        removeCurrentActiveClass();
        $currentActiveElement.addClass('active-current');

        $tocSelector[0].scrollTop = $currentActiveElement.position().top;
      })
      .on('clear.bs.scrollspy', function () {
        removeCurrentActiveClass();
      });

    function removeCurrentActiveClass () {
      $(tocSelector + ' ' + activeCurrentSelector)
        .removeClass(activeCurrentSelector.substring(1));
    }

    function processTOC () {
      getTOCMaxHeight();
      toggleTOCOverflowIndicators();
    }

    function getTOCMaxHeight () {
      var height = $('.sidebar').height() -
                   $tocSelector.position().top -
                   $('.post-toc-indicator-bottom').height();

      $tocSelector.css('height', height);

      return height;
    }

    function toggleTOCOverflowIndicators () {
      tocOverflowIndicator(
        '.post-toc-indicator-top',
        $tocSelector.scrollTop() > 0 ? 'show' : 'hide'
      );

      tocOverflowIndicator(
        '.post-toc-indicator-bottom',
        $tocSelector.scrollTop() >= $tocSelector.find('ol').height() - $tocSelector.height() ? 'hide' : 'show'
      )
    }

    $(document).on('sidebar.motion.complete', function () {
      processTOC();
    });

    $('body').scrollspy({ target: tocSelector });
    $(window).on('resize', function () {
      if ( $('.sidebar').hasClass('sidebar-active') ) {
        processTOC();
      }
    });

    onScroll($tocSelector);

    function onScroll (element) {
      element.on('mousewheel DOMMouseScroll', function (event) {
          var oe = event.originalEvent;
          var delta = oe.wheelDelta || -oe.detail;

          this.scrollTop += ( delta < 0 ? 1 : -1 ) * 30;
          event.preventDefault();

          toggleTOCOverflowIndicators();
      });
    }

    function tocOverflowIndicator (indicator, action) {
      var $indicator = $(indicator);
      var opacity = action === 'show' ? 1 : 0;
      $indicator.velocity ?
        $indicator.velocity('stop').velocity({
          opacity: opacity
        }, { duration: 100 }) :
        $indicator.stop().animate({
          opacity: opacity
        }, 100);
    }

  });
</script>

<script type="text/javascript" id="sidebar.nav">
  $(document).ready(function () {
    var html = $('html');
    var TAB_ANIMATE_DURATION = 200;
    var hasVelocity = $.isFunction(html.velocity);

    $('.sidebar-nav li').on('click', function () {
      var item = $(this);
      var activeTabClassName = 'sidebar-nav-active';
      var activePanelClassName = 'sidebar-panel-active';
      if (item.hasClass(activeTabClassName)) {
        return;
      }

      var currentTarget = $('.' + activePanelClassName);
      var target = $('.' + item.data('target'));

      hasVelocity ?
        currentTarget.velocity('transition.slideUpOut', TAB_ANIMATE_DURATION, function () {
          target
            .velocity('stop')
            .velocity('transition.slideDownIn', TAB_ANIMATE_DURATION)
            .addClass(activePanelClassName);
        }) :
        currentTarget.animate({ opacity: 0 }, TAB_ANIMATE_DURATION, function () {
          currentTarget.hide();
          target
            .stop()
            .css({'opacity': 0, 'display': 'block'})
            .animate({ opacity: 1 }, TAB_ANIMATE_DURATION, function () {
              currentTarget.removeClass(activePanelClassName);
              target.addClass(activePanelClassName);
            });
        });

      item.siblings().removeClass(activeTabClassName);
      item.addClass(activeTabClassName);
    });

    $('.post-toc a').on('click', function (e) {
      e.preventDefault();
      var targetSelector = NexT.utils.escapeSelector(this.getAttribute('href'));
      var offset = $(targetSelector).offset().top;
      hasVelocity ?
        html.velocity('stop').velocity('scroll', {
          offset: offset  + 'px',
          mobileHA: false
        }) :
        $('html, body').stop().animate({
          scrollTop: offset
        }, 500);
    });

    // Expand sidebar on post detail page by default, when post has a toc.
    NexT.motion.middleWares.sidebar = function () {
      var $tocContent = $('.post-toc-content');

      if (CONFIG.sidebar.display === 'post' || CONFIG.sidebar.display === 'always') {
        if ($tocContent.length > 0 && $tocContent.html().trim().length > 0) {
          NexT.utils.displaySidebar();
        }
      }
    };
  });
</script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=0.5.0"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"coderleon"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
  





  
  
  
  <script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
        processEscapes: true,
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
    });
  </script>

  <script type="text/x-mathjax-config">
    MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
      for (i=0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';
      }
    });
  </script>

  
    <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
  <script>AV.initialize("pJdYd3bVkuCMKiGlqFilwfbY-gzGzoHsz", "5HFxgKVCT5jJDtW3gHibs0Tn");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



 
</body>
</html>
